<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<head th:include="/base/common_css('test')">
<body>
<div th:include="/base/common_banner"></div>
<!-- Main content starts -->

<div class="content">
    <!-- Sidebar -->
    <div th:include="/base/common_menu"></div>
    <!-- Sidebar
    <div class="sidebar">
        <div class="sidebar-dropdown"><a href="#">Navigation</a></div>

    </div>-->
    <!-- Matter -->
    <div class="mainbar">
        <!-- Page heading -->
        <div th:include="/base/common_pageHeader"></div>

        <div class="matter">
            <div class="container">
                <!--按条件查询-->
                <div class="panel panel-default">

                    <div class="panel-body">

                        <form id="formSearch" class="form-horizontal">
                            <div class="form-group" style="margin-top:20px">
                                <div class="col-sm-2">
                                    <lable class="control-label" style="font-size: large; color:#3c763d">编辑分组信息</lable>
                                </div>
                                <div class="col-sm-1">
                                    <a href="/view/groupList?pageNumber=1&pageSize=10" ><span style="font-size: 15px;color:#60615d">分组列表</span></a>
                                </div>
                                <div class="col-sm-1" style="text-align:left;">
                                    <a  style="background: rgb(96, 97, 93)" ><span style="font-size: 15px;color:#fdfff4">编辑</span></a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-6">


                        <div class="widget wgreen">

                            <div class="widget-head">
                                <div class="pull-left">分组编辑</div>
                                <div class="widget-icons pull-right">
                                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a>
                                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>

                            <div class="widget-content">
                                <div class="padd">

                                    <!-- Form starts.  -->
                                    <form class="form-horizontal" role="form" action="#" method="post">

                                        <div class="modal-body">
                                            <form action="#" method="post"
                                                  enctype="multipart/form-data">
                                                <input class="col-lg-4 form-control " type="hidden" id="groupId"
                                                       th:value="${groupId}">
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label">分组名</label>
                                                    <div class="col-lg-8">
                                                        <input type="text" th:value="${groupName}" class="form-control"
                                                               id="groupName" placeholder="分组名">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label">分组描述</label>
                                                    <div class="col-lg-8">
                                                        <input type="text" th:value="${groupDescription}"
                                                               class="form-control"
                                                               id="groupDescription" placeholder="分组描述">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label">分组类型</label>
                                                    <div class="col-lg-8">
                                                        <input type="text" th:value="${groupType}" class="form-control"
                                                               id="groupType" placeholder="分组类型">
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </form>
                                    <div class="modal-footer">
                                        <button type="button" onclick="saveGroup()"
                                                class="btn btn-success">保存
                                        </button>
                                        <button type="button" class="btn btn-cancel" onclick="cancless()">取消
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- Mainbar ends -->
<div class="clearfix"></div>

</div>
<!-- Content ends -->

<div th:include="/base/common_footer"></div>
<!-- Scroll to top -->
<span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span>
<!--js????-->
<div th:include="/base/common_js"></div>
<script type="text/javascript">
    function cancless() {
        window.location.href  = "/view/groupList?pageNumber=1&pageSize=10";
    }
    //保存新增/修改
    function saveGroup() {
        var data = {
            'groupId': $('#groupId').val(),
            'groupName': $('#groupName').val(),
            'groupDescription': $('#groupDescription').val(),
            'groupType': $('#groupType').val()
        }
        $.ajax({
            url: "/view/saveOrupdateGroup",
            type: "POST",
            dataType: "json",
            data: data,
            success: function (data) {
                if (data.data) {
                    window.location.href  = "/view/groupList?pageNumber=1&pageSize=10";
                }
            },
        });
    }
</script>
</body>
</html>